import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import java.awt.Color;
import javax.swing.ImageIcon;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;


public class FreeParkingUI extends JPanel {
	private BoardUi board;
	private JButton btnReturn;

	public FreeParkingUI(Player currentPlayer, FreeParking freeParking, BoardUi board_) {
		this.board=board_;
		setBackground(new Color(255, 228, 225));
		setLayout(null);
		
		btnReturn = new JButton("Return");
		btnReturn.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				returnGame();
			}
		});
		btnReturn.setBounds(198, 88, 82, 23);
		add(btnReturn);
		
		JLabel label = new JLabel("");
		label.setIcon(new ImageIcon(FreeParkingUI.class.getResource("/TitleDeeds/FreeParkingUi.jpg")));
		label.setBounds(0, 0, 200, 200);
		add(label);
	}
	
	public void returnGame(){
		setVisible(false);
	//	board.getGameButtonUI().enableEndTurnBtn();
		board.getDiceUI().rolledDoubles();
	}

}
